import request from '@/utils/request'

const api = {
    basepath: '/swgl'
}

// 综合查询
export function getSwglZhcxList(parameter) {
    return request({
        url: api.basepath + '/queryZhcx',
        method: 'get',
        params: parameter
    })
}

// 收文漏号查询
export function getlh(parameter) {
    return request({
        url: api.basepath + '/lh',
        method: 'get',
        params: parameter
    })
}

export function getInfo(unid) {
    return request({
        url: api.basepath + '/' + unid,
        method: 'get'
    })
}

export function getInit() {
    return request({
        url: api.basepath + '/init',
        method: 'get'
    })
}

export function getLshWithLwlb(parameter) {
    return request({
        url: api.basepath + '/getLshWithLwlb',
        method: 'get',
        params: parameter
    })
}

export function zbbmtreeselect(parameter) {
    return request({
        url: api.basepath + '/zbbm/list',
        method: 'get'
    })
}

export function searchZbbmtreeselect(bm) {
    return request({
        url: '/swgl/swBybm/' + bm,
        method: 'get'
    })
}

export function getSwglList(parameter) {
    return request({
        url: api.basepath + '/list',
        method: 'get',
        params: parameter
    })
}

export function getZhcxList(parameter) {
    return request({
        url: api.basepath + '/zhcxlist',
        method: 'get',
        params: parameter
    })
}

export function getYayjList(parameter) {
    return request({
        url: api.basepath + '/dayj/list',
        method: 'get',
        params: parameter
    })
}

export function getSwglYearList() {
    return request({
        url: api.basepath + '/listWithYear',
        method: 'get'
    })
}

export function getSwglListnd(parameter) {
    return request({
        url: api.basepath + '/listWithNd',
        method: 'get',
        params: parameter
    })
}
export function exportSwglList(parameter) {
    return request({
        url: api.basepath + '/export',
        method: 'get',
        params: parameter
    })
}

export function getSwglCbList(parameter) {
    return request({
        url: api.basepath + '/cb/list',
        method: 'get',
        params: parameter
    })
}

export function saveSwgl(parameter) {
    return request({
        url: api.basepath,
        method: 'post',
        data: parameter,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function delSwgl(parameter) {
    return request({
        url: api.basepath,
        method: 'Delete',
        params: parameter
    })
}

export function base64flowimage(businessKey) {
    return request({
        url: api.basepath + '/base64flowimage/' + businessKey,
        method: 'get'
    })
}

export function getSendFlowNode(unid) {
    return request({
        url: api.basepath + '/getSendFlowNode?unid=' + unid,
        method: 'get'
    })
}

export function getHistoryProcess(unid) {
    return request({
        url: api.basepath + '/getHistoryProcess?businessKey=' + unid,
        method: 'get'
    })
}

export function fwglSendDoc(urlparameter, data) {
    return request({
        url: api.basepath + '/sendDoc',
        method: 'post',
        params: urlparameter,
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function readedDoc(data) {
    return request({
        url: api.basepath + '/readedDoc',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function quickHand(data) {
    return request({
        url: api.basepath + '/quickHand',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function publishDoc(data) {
    return request({
        url: api.basepath + '/publishDoc',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function getCallbackNode(unid) {
    return request({
        url: api.basepath + '/getCallbackNode/' + unid,
        method: 'get'
    })
}

export function callbackDoc(urlparameter, dataparams) {
    return request({
        url: api.basepath + '/callbackDoc',
        method: 'post',
        data: dataparams,
        params: urlparameter,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function writeNotion(dataparams) {
    return request({
        url: api.basepath + '/writeNotion',
        method: 'post',
        data: dataparams,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function finishDoc(dataparams) {
    return request({
        url: api.basepath + '/finishDoc',
        method: 'post',
        data: dataparams,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function finalizeDoc(dataparams) {
    return request({
        url: '/flow/func/finalizeDoc',
        method: 'get',
        data: dataparams,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export function unFinalizeDoc(dataparams) {
    return request({
        url: '/flow/func/unFinalizeDoc',
        method: 'get',
        data: dataparams,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

export const swglExport = api.basepath + '/export'